In applicant's copending application Ser. No. 614,431, filed Sept. 18, 1975, an apparatus for cutting pipes, plates, and the like and for the welding same has been disclosed. In said application, the control of the carriage along a pipe or the like, the control of the rotation of the tool head, and the control of the longitudinal movement of the tool head relative to the carriage was achieved by means of a pair of profile curves placed on the pipe which were detected by an optical system which controlled the motors for the rotation of the tool head and the longitudinal movement of a pair of bracket arms to which is mounted the tool head. By the proper choice of profile curves, the particular angular attack of the tool head and the particular angle of cut of the pipe desired was attainable.